package com.tac.controller.wms;

import com.tac.common.result.Result;
import com.tac.pojo.wms.MaterialType;
import com.tac.service.wms.MaterialTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/materialType")
@Api(tags = "智能仓储WMS--物料分类")
@CrossOrigin
public class MaterialTypeController {

    @Autowired
    private MaterialTypeService materialTypeService;



    @ApiOperation("查看分类列表")
    //查看分类列表
    @GetMapping("/getList")
    public Result<List<MaterialType>> getList(){
        return materialTypeService.getList(0);
    }


    @ApiOperation("物料修改分类")
    @PutMapping("/update")
    public Result update(@RequestBody  MaterialType materialType){
        return materialTypeService.update(materialType);
    }
    @PostMapping("/save")
    @ApiOperation("添加物料分类")
    public Result save(@RequestBody  MaterialType materialType){
        return materialTypeService.save(materialType);
    }

    @DeleteMapping("/remove")
    @ApiOperation("删除物料分类")
    public Result remove(@RequestBody List<Integer> ids){
        return materialTypeService.remove(ids);
    }


}
